
#include <jni.h>

#ifdef __cplusplus
extern "C" {
#endif

/*
* 为某一个类注册本地方法
*/
int registerNativeMethods(JNIEnv *env, const char *className,const JNINativeMethod *nativeMethods, int numMethods) {
    jclass clazz = (*env)->FindClass(env, className);
    if (clazz == NULL) {
        return JNI_FALSE;
    }
    if ((*env)->RegisterNatives(env, clazz, nativeMethods, numMethods) < 0) {
        return JNI_FALSE;
    }
    return JNI_TRUE;
}


#ifdef __cplusplus
}
#endif
